import os
import subprocess
import sys
print("  _____ _                         _   _             _    ")
print(" / ____| |                   /\  | | | |           | |   ")
print("| (___ | | _____      __    /  \ | |_| |_ __ _  ___| | __")
print(" \___ \| |/ _ \ \ /\ / /   / /\ \| __| __/ _` |/ __| |/ / ")
print(" ____) | | (_) \ V  V /   / ____ \ |_| || (_| | (__|   <  ")
print("|_____/|_|\___/ \_/\_/   /_/    \_\__|\__\__,_|\___|_|\_\ ")
print("\033[1;32;40m[*]慢速攻击是一种针对目标系统的网络安全攻击，通过持续发送低频率请求，逐渐占用其资源或网络带宽，最终导致服务不可用或系统性能下降。")
print("\033[1;37;40m")

files = {
    1: {"name": "ddos_cn/Slow_Attack/Slow_Read_attack.py", "description": "慢速读取攻击"},
    2: {"name": "ddos_cn/Slow_Attack/Slowloris_attack.py", "description": "Slowloris攻击"},
    3: {"name": "ddos_cn/Slow_Attack/Slow_POST_attack.py", "description": "慢速POST攻击"},
    4: {"name": "ddos_cn/Slow_Attack/Slow_GET_attack.py", "description": "慢速GET攻击"},
    5: {"name": "ddos_cn/Slow_Attack/Slow_DNS_attack.py", "description": "慢速DNS攻击"},
    6: {"name": "ddos_cn/Slow_Attack/slow_write_attack.py", "description": "慢速写入攻击"},
    7: {"name": "ddos_cn/Slow_Attack/Slow_SSL_attack.py", "description": "慢速SSL攻击"},
}

def run_python_file(file_number):
    if file_number in files:
        file_info = files[file_number]
        file_name = file_info["name"]
        file_description = file_info["description"]
        if os.path.exists(file_name) and file_name.endswith('.py'):
            print("ok")
            subprocess.run([sys.executable, file_name])
        else:
            print("错误：文件不存在。")
    else:
        print("错误：无效的选择。")

def main():
    print("请选择攻击模式：")
    for num, file_info in files.items():
        print(f"[{num}] {file_info['description']}")
    choice = int(input("请输入数字："))
    run_python_file(choice)

if __name__ == "__main__":
    main()
    
#sansjtw https://sansjtw.xyz https://github.com/sansjtw